<?php

//服务器和数据库信息
$servername = "localhost";
$username = "root";
$password = "";
$dbName = "mydb";
$tableName = "myguest";

//create connection
$conn = new mysqli($servername, $username, $password, $dbName);

//check connection 
if ($conn->connect_error) {
  die('fail to connect' . $conn->connect_error);
}

$sql = "show index from $tableName";
$result = $conn->query($sql);
// var_dump($result->num_rows);
// var_dump($result);
while($row = $result->fetch_assoc()){
  var_dump($row);
}
// var_dump($result);
$result->free_result();
$conn->close();
// var_dump($result );
// var_dump($row);